home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / libfpvm / WIN32 / Pvmfreduce.c < prev    next >
C/C++ Source or Header  |  1997-07-22  |  2KB  |  97 lines

  1.  
  2. /* $Id: Pvmfreduce.c,v 1.1 1997/06/27 16:30:33 pvmsrc Exp $ */
  3.  
  4. #ifdef WIN32
  5. #include "..\..\include\pvm3.h"
  6. #include "..\..\src\pvmwin.h"
  7. #else 
  8. #include "pvm3.h"
  9. #endif
  10.  
  11. #include "pvm_consts.h"
  12.  
  13. #ifdef __WATCOMC__
  14. #include "watforstr.h"
  15. void __fortran
  16. PVMFREDUCE (func, data,count, datatype, msgtag, gname_str, rootinst, info)
  17. void (*func)();
  18. void *data;
  19. int *count, *datatype, *msgtag, *rootinst, *info;
  20. WatcomFortranStr* gname_str;
  21. {
  22.    char* gname_ptr = gname_str->strP;
  23.    int   gname_len = gname_str->len;
  24. #else
  25. void __stdcall
  26. PVMFREDUCE (func, data,count, datatype, msgtag, gname_ptr,gname_len, rootinst, info)
  27. #ifdef UXPM
  28. void (**func)(); /* correction for Fujitsu FORTRAN77 EX */
  29. #else
  30. void (*func)();
  31. #endif
  32. void *data;
  33. int *count, *datatype, *msgtag, *rootinst, *info;
  34. char * gname_ptr; int gname_len;
  35. {
  36. #endif
  37.    
  38.   char tgroup[MAX_GRP_NAME + 1];
  39.  
  40.   /*
  41.    * Copy the group name to make sure there's a NUL at the end.
  42.    */
  43.   if (ftocstr(tgroup, sizeof(tgroup), gname_ptr, gname_len)){
  44.     *info = PvmBadParam;
  45.     return;
  46.     }
  47.  
  48. #ifdef UXPM
  49.   *info = pvm_reduce(*func, data, *count, *datatype, *msgtag, tgroup, 
  50.                      *rootinst);
  51. #else
  52.   *info = pvm_reduce(func, data, *count, *datatype, *msgtag, tgroup, 
  53.                      *rootinst);
  54. #endif
  55.  
  56. }
  57.  
  58. /* various reduction functions are defined here */
  59.  
  60. void __fortran
  61. PVMMAX (datatype, data, work, count, info)
  62. int *datatype;
  63. void *data, *work;
  64. int *count, *info;
  65. {
  66.   PvmMax(datatype, data, work, count, info);
  67. }
  68.  
  69.  
  70.  
  71. void __fortran
  72. PVMMIN (datatype, data, work, count, info)
  73. int *datatype;
  74. void *data, *work;
  75. int *count, *info;
  76. {
  77.   PvmMin(datatype, data, work, count, info);
  78. }
  79.  
  80. void __fortran
  81. PVMSUM (datatype, data, work, count, info)
  82. int *datatype;
  83. void *data, *work;
  84. int *count, *info;
  85. {
  86.   PvmSum(datatype, data, work, count, info);
  87. }
  88.  
  89. void __fortran
  90. PVMPRODUCT (datatype, data, work, count, info)
  91. int *datatype;
  92. void *data, *work;
  93. int *count, *info;
  94. {
  95.   PvmProduct(datatype, data, work, count, info);
  96. }
  97.